#!/bin/bash
"""
设置 Playwright MCP 每日发布系统
"""

echo "🚀 设置 Playwright MCP 每日发布系统..."

# 检查 Node.js
if ! command -v node &> /dev/null; then
    echo "❌ Node.js 未安装，请先安装 Node.js 18+"
    exit 1
fi

# 检查 Python
if ! command -v python3 &> /dev/null; then
    echo "❌ Python3 未安装，请先安装 Python3"
    exit 1
fi

# 安装 Node.js 依赖
echo "📦 安装 Node.js 依赖..."
npm install

# 安装 Python 依赖
echo "📦 安装 Python 依赖..."
pip3 install -r requirements.txt

# 创建必要目录
mkdir -p logs
mkdir -p images

# 设置执行权限
chmod +x playwright-mcp-server.js
chmod +x mcp-client.py

echo "✅ 设置完成！"
echo ""
echo "🎯 使用方法："
echo "1. 启动 MCP 服务器: npm start"
echo "2. 运行发布客户端: python3 mcp-client.py"
echo ""
echo "📁 项目结构："
echo "  playwright-mcp-server.js  - MCP 服务器"
echo "  mcp-client.py            - Python 客户端"
echo "  logs/                    - 日志目录"
echo "  images/                  - 图片目录"
echo ""
echo "🔧 开发调试："
echo "  npm run dev              - 开发模式（热重载）"
echo "  curl http://localhost:3000/health - 健康检查"
